package com.nts.visionworks.core.security.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * FunctionDefinitions generated by hbm2java
 */
@Entity
@Table(name = "function_definitions", catalog = "visionworks", uniqueConstraints =
{ @UniqueConstraint(columnNames = "FunctionName"),
		@UniqueConstraint(columnNames = "FunctionKey") })
public class FunctionDefinitions implements java.io.Serializable
{

	private Integer functionId;
	private String functionKey;
	private String functionName;
	private Set<SecurityAuthorityFunction> securityAuthorityFunctions = new HashSet<SecurityAuthorityFunction>(
			0);

	public FunctionDefinitions()
	{
	}

	public FunctionDefinitions(String functionKey, String functionName)
	{
		this.functionKey = functionKey;
		this.functionName = functionName;
	}

	public FunctionDefinitions(String functionKey, String functionName,
			Set<SecurityAuthorityFunction> securityAuthorityFunctions)
	{
		this.functionKey = functionKey;
		this.functionName = functionName;
		this.securityAuthorityFunctions = securityAuthorityFunctions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "FunctionId", unique = true, nullable = false)
	public Integer getFunctionId()
	{
		return this.functionId;
	}

	public void setFunctionId(Integer functionId)
	{
		this.functionId = functionId;
	}

	@NotNull(message = "validation.functionDefinitions.functionKey.notNull")
	@Size(message = "validation.functionDefinitions.functionKey.length", max = 50, min = 1)
	@Column(name = "FunctionKey", unique = true, nullable = false, length = 50)
	public String getFunctionKey()
	{
		return this.functionKey;
	}

	public void setFunctionKey(String functionKey)
	{
		this.functionKey = functionKey;
	}

	@NotNull(message = "validation.functionDefinitions.functionName.notNull")
	@Size(message = "validation.functionDefinitions.functionName.length", max = 200, min = 1)
	@Column(name = "FunctionName", unique = true, nullable = false, length = 200)
	public String getFunctionName()
	{
		return this.functionName;
	}

	public void setFunctionName(String functionName)
	{
		this.functionName = functionName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "functionDefinitions")
	public Set<SecurityAuthorityFunction> getSecurityAuthorityFunctions()
	{
		return this.securityAuthorityFunctions;
	}

	public void setSecurityAuthorityFunctions(
			Set<SecurityAuthorityFunction> securityAuthorityFunctions)
	{
		this.securityAuthorityFunctions = securityAuthorityFunctions;
	}

}
